package com.sports.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sports.mapper.SportsMapper;
import com.sports.pojo.Sports;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SportsServiceImpl implements ISportsService {
    @Autowired
    private SportsMapper mapper;


    @Override
    public List<Sports> list() {
        return mapper.selectList(new QueryWrapper<>());
    }

    @Override
    public Sports getById(Integer id) {
        return mapper.selectById(id);
    }

    @Override
    public Integer add(Sports sports) {
        return mapper.insert(sports);
    }

    @Override
    public Integer update(Sports sports) {
        return mapper.updateById(sports);
    }

    @Override
    public Integer delete(Integer id) {
        return mapper.deleteById(id);
    }

}
